<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCommentsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comments', function (Blueprint $table) {
            $table->bigIncrements('comment_id');
            $table->bigInteger('post_id', $autoIncrement = false, $unsigned = true);
            $table->string('comment_author', 255);
            $table->string('comment_author_email', 100);
            $table->string('comment_author_url', 200)->nullable();
            $table->string('comment_author_IP', 100);
            $table->text('comment_content');
            $table->integer('comment_karma')->default(0);
            $table->string('comment_approved', 20)->default(0);
            $table->string('comment_agent', 255);
            $table->string('comment_type', 20)->nullable();
            $table->bigInteger('comment_parent', $autoIncrement = false, $unsigned = true)->default(0);
            $table->integer('user_id', $autoIncrement = false, $unsigned = true)->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('comments');
    }
}
